/*
 * @LastEditors: caiwenqi
 * @EditorsDescripttion: 3.4.6版本开发
 * @LastEditTime: 2020-08-03 09:51:41
 */
/*
 * @Author: zhubingshuai
 * @Date: 2019-11-13 09:50:48
 * @Last Modified by: fanweilun
 * @Last Modified time: 2020-5-20 9:40:20
 *
 */
<template>
    <div class="customerCenterDetail">
        <!-- <loading :showLoading="showLoading"></loading> -->
        <mt-loadmore :top-method="loadTop" ref="loadmore">
            <div class="contentBox">
                <!-- header -->
                <div class="item-block">
                    <div class="item-container">
                        <div class="item-c-title">{{detailInfo.customerName || ''}}</div>
                            <div class="item-c-id">
                                <!-- <span class="icon-box" v-if="detailInfo.sex == 0 || detailInfo.sex==1">
                                    <i class="iconfont" v-if="detailInfo.sex ==1" style="color:#56B6F5">&#xe60b;</i>
                                    <i class="iconfont" style="color: #D74764;" v-if="detailInfo.sex ==0">&#xe60e;</i>
                                </span> -->
                                客户编号： <span v-if="detailInfo.customerStatus=='TC'">--</span>
                                <span v-if="detailInfo.customerStatus ==0 || detailInfo.customerStatus==1">{{detailInfo.customerNo || '--'}}</span>
                                <!-- <span class="verticalbar" v-if="detailInfo.customerResource">|</span>
                                <span v-if="detailInfo.customerResource">来自：{{detailInfo.customerResource}}</span> -->
                            </div>
                            <div class="item-flex-box">
                                <div class="item-flex-fl">
                                    <div class="item-label-box">
                                        <span class="item-label-sex" v-if="detailInfo.sex != null">{{detailInfo.sex == 0 ? '女' : '男'}}</span>
                                        <span class="verticalbar" v-if="detailInfo.tier != null && detailInfo.sex != null">|</span>
                                        <span class="item-label" v-if="detailInfo.tier == 0">
                                             财富客户
                                        </span>
                                        <span class="item-label" v-if="detailInfo.tier==1">
                                            银杏级
                                        </span>
                                        <span class="item-label" v-if="detailInfo.tier==2">
                                            白金级
                                        </span>
                                        <span class="item-label" v-if="detailInfo.tier==3">
                                            黑金级
                                        </span>
                                        <span class="item-label" v-if="detailInfo.tier==4">
                                            黑钻级
                                        </span>
                                        <span class="item-label" v-if="detailInfo.tier==5">
                                            超级黑钻
                                        </span>
                                        <!-- <span v-if="detailInfo.scoreResult"> -->
                                        <span class="verticalbar" v-if="(detailInfo.sex != null && detailInfo.scoreResult !== 4 && detailInfo.scoreResult != null) || detailInfo.tier != null && (detailInfo.scoreResult !== 4 && detailInfo.scoreResult != null)">|</span>
                                        <!-- <span class="verticalbar" v-if="">|</span> -->
                                            <span class="item-label" v-if="detailInfo.scoreResult && detailInfo.scoreResult !== 4" style="line-height:.82rem">
                                                <span v-if="detailInfo.scoreResult == 1">A</span>
                                                <span v-if="detailInfo.scoreResult == 2">B</span>
                                                <span v-if="detailInfo.scoreResult == 3">C</span>
                                                <span>类客户</span>
                                            </span>
                                            <span class="verticalbar" v-if="detailInfo.custidentifList">|</span>
                                               <span class="item-label item-interaction has-pointer" v-if="detailInfo.custidentifList" :class="transformCustomerType(labelItem)" v-for="(labelItem, index) in detailInfo.custidentifList" :key="index" @click="showTipPop" htmdEvt="clickShowPop_btn">
                                                 {{labelItem}}<i class="iconfont">&#xe63d;</i>
                                            </span>


                                            <!-- <span class="item-label item-label-light-brown has-pointer">半休眠<i class="iconfont">&#xe604;</i></span> -->
                                            <!-- <span class="item-label item-label-blue has-pointer">活跃<i class="iconfont">&#xe63c;</i></span> -->
                                            <!-- <span class="item-label item-label-orange has-pointer" v-if="detailInfo.tier==4" @click="showTip">
                                                高关注<i class="iconfont">&#xe609;</i>
                                            </span> -->
                                        <!-- </span> -->

                                    </div>
                                </div>
                                <!-- <div class="tel-button" v-if="detailInfo.customerStatus=='TC' && detailInfo.phone" htmdEvt="customerCall_btn" @click="callPhone(detailInfo.phone)"> -->
<!--                                    <a :href="'tel:' + detailInfo.phone">-->
<!--                                    </a>-->
                                    <!-- <i class="iconfont">&#xe64c;</i> -->
                                <!-- </div> -->
                                <!-- <div class="tel-button" v-if="(detailInfo.customerStatus==0 || detailInfo.customerStatus==1) && detailInfo.mobileInternet" htmdEvt="customerCall_btn" @click="callPhone(detailInfo.mobileInternet)"> -->
<!--                                    <a :href="'tel:' + detailInfo.mobileInternet">-->
<!--                                    </a>-->
                                    <!-- <i class="iconfont">&#xe64c;</i> -->
                                <!-- </div> -->
                                <!-- <div class="tel-button" htmdEvt="customerCall_btn">
                                    <a :href="'tel: 13520010862'">
                                        <i class="iconfont">&#xe60d;</i>
                                    </a>
                                </div> -->
                            </div>
                            <div class="labelList" v-if="showLabel">
                                <span v-for="(item,index) in nowLabels" :key="index">{{item}}</span>
                                <!-- <span v-for="(item,index) in lsf" :key="index">{{item}}</span> -->
                                    <!-- isFlag==1时，天津大区显示-->
                                <span v-if="isFlag==1" style="padding: 0.1rem">
                                    <img v-if="nowLabels.length>0" class="addMore has-pointer" src="../../../img/detailIcon/addMore.png" @click="openBlock" htmdEvt="clickShowSign_btn">
                                    <img v-if="nowLabels.length==0" class="addLabel has-pointer" src="../../../img/detailIcon/addLabel.png" @click="openBlock" htmdEvt="clickShowSignSmall_btn">
                                </span>
                            </div>
                            <div class="item-header-third border-top">
                                <div class="item-label-small-box">
                                    <span class="item-label-small">
                                        <img src="../../../img/detailIcon/zs@2x.png" v-if="detailInfo.hadRegister">
                                        <img src="../../../img/detailIcon/zn@2x.png" v-else>
                                    </span>
                                    <span class="item-label-small">
                                        <img src="../../../img/detailIcon/ss@2x.png" v-if="detailInfo.hadRealName">
                                        <img src="../../../img/detailIcon/sn@2x.png" v-else>
                                    </span>
                                    <span class="item-label-small">
                                        <img src="../../../img/detailIcon/fs@2x.png" v-if="detailInfo.hadRiskTest">
                                        <img src="../../../img/detailIcon/fn@2x.png" v-else>
                                    </span>
                                    <span class="item-label-small">
                                        <img src="../../../img/detailIcon/hs@2x.png" v-if="detailInfo.hadQualifiedAuth">
                                        <img src="../../../img/detailIcon/hn@2x.png" v-else>
                                    </span>
                                    <span class="item-label-small">
                                        <img src="../../../img/detailIcon/z2s@2x.png" v-if="detailInfo.hadMajorAuth">
                                        <img src="../../../img/detailIcon/z2n@2x.png" v-else>
                                    </span>
                                </div>
                                <!-- 电话区域 -->
                                <div class="phone-box" v-if="detailInfo.customerStatus=='TC' && detailInfo.phone" @click="callPhone(detailInfo.phone)" htmdEvt="clickCallphone_btn">
                                    <i class="iconfont" style="font-size:.7rem">&#xe656;</i>
                                    {{detailInfo.phoneFormat}}
                                </div>
                                <div class="phone-box" v-else-if="(detailInfo.customerStatus==0 || detailInfo.customerStatus==1) && detailInfo.mobileInternet" @click="callPhone(detailInfo.mobileInternet)" htmdEvt="clickCallphoneTwo_btn">
                                    <i class="iconfont" style="font-size:.7rem">&#xe656;</i>
                                    {{detailInfo.mobileInternetFormat}}
                                </div>
                                <!-- 无电话区域 -->

                                <div class="nophone-box" v-else>
                                   <i class="iconfont" style="font-size:.7rem">&#xe659;</i>
                                </div>
                                <!-- <div class="header-btn-box">
                                    <button type="button" class="header-btn has-pointer" @click="toAnother('5')" htmdEvt="customerInfo_btn">客户资料</button>
                                    <button type="button" class="header-btn has-pointer" @click="toAppPage('11', detailInfo.trackRecordCount)" htmdEvt="customerTrackRecord_btn">跟踪记录({{detailInfo.trackRecordCount || '0'}})</button>
                                </div> -->

                            </div>
                            <!-- 新客户资料等区域 -->
                            <div class="cusdata-box">
                                <button type="button" class="header-btn has-pointer" @click="toAnother('5')" htmdEvt="customerInfo_btn" style="margin-right: .4rem;">客户资料</button>
                                <button type="button" class="header-btn has-pointer" @click="toAppPage('11', detailInfo.trackRecordCount)" htmdEvt="customerTrackRecord_btn" style="margin-right: .4rem;">跟踪记录<span>({{detailInfo.trackRecordCount || '0'}})</span></button>
                                <button type="button" class="header-btn has-pointer" @click="toHpage" htmdEvt="clickCallrecord_btn">通话记录<span>({{detailInfo.telCount >= 100 ? '99+' : detailInfo.telCount}})</span></button>
                            </div>
                    </div>
                </div>
                <!-- 新增加判断只有客户不是待注册且系统来源有值时展示 -->
                <div class="item-block" v-if="detailInfo.dealStatus!=2&&detailInfo.customerResource">
                    <div :class="detailInfo.systemResource==17||detailInfo.systemResource==26?'border-bottom item-title':'item-title'">客户来源：{{detailInfo.customerResource}}</div>
                    <div class="item-container" v-if="detailInfo.systemResource==17||detailInfo.systemResource==26">
                        <div class="item-btn has-pointer needshow" v-if="detailInfo.systemResource==17" @click="toAnother('7')" htmdEvt="resourceChain_btn">
                            <div class="activeTitle">关系链</div>
                            <i class="iconfont">&#xe664;</i>
                        </div>
                        <div class="item-btn has-pointer needshow" v-if="detailInfo.systemResource==26&&detailInfo.actName" @click="jumpMarketingActivitiesDetail(detailInfo.activityId)" htmdEvt="marketingActivitiesDetail_btn">
                            <div class="activeTitle">
                                <div class="activeTitleCont">{{detailInfo.actName}}</div>
                            </div>
                            <i class="iconfont">&#xe664;</i>
                        </div>
                        <div class="item-btn has-pointer needshow" v-if="detailInfo.systemResource==26 && !detailInfo.actName">
                            <div class="activeTitle">
                                <div class="activeTitleCont">活动已删除</div>
                            </div>
                            <i class="iconfont">&nbsp;</i>
                        </div>
                    </div>
                </div>
                <!-- 常用资料 -->
                <div class="item-block" v-if="cusType != 2">
                    <div class="item-title border-bottom">常用资料</div>
                    <div class="item-container commonInformation">
                        <div class="item-btn-box item-btn-start">
                            <button type="button" class="item-btn has-pointer" @click="toAnother('1')" htmdEvt="customerContact_btn">
                                联系方式
                            </button>
                            <button class="item-btn has-pointer" @click="toAnother('2')" htmdEvt="customerBankInfo_btn">
                                银行卡信息
                            </button>
                            <div class="item-btn has-pointer" v-if="detailInfo.customerStatus == 1" @click="toAnother('3')" htmdEvt="customerBounds_btn">
                                客户持仓
                            </div>
                            <div class="item-btn has-pointer" @click="toAnother('4')" htmdEvt="customerDealList_btn" v-if="cusType == 1">
                                交易流水
                            </div>
                            <div class="item-btn has-pointer" @click="toOrderIntension">
                                预约查询
                            </div>
                            <div class="item-btn has-pointer" @click="toAnother('6')" htmdEvt="riskAuthentication_btn">
                                风测及认证
                            </div>
                            <div class="item-btn has-pointer" @click="toAnother('7')" htmdEvt="oldBringsNewChain_btn">
                                老带新关系链
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 客户意向 -->
                <!-- {{isMeetRecordCount}} -->
                <div class="item-block" v-if="showBlock || isMeetRecordCount">
                    <div class="item-title border-bottom has-pointer">客户意向
                        <!-- <span>查看详情 <i class="iconfont">&#xe606;</i></span> -->
                    </div>
                    <div class="item-container" style="padding: 0.75rem .2rem; padding-left: .6rem">
                        <div class="item-service-block">
                            <div class="service-item-box" v-if="detailCount.viewProductCount > 0">
                                <div class="service-item has-pointer" @click="toAppPage('1', detailCount.viewProductCount)" htmdEvt="customerReviewProduct_btn">
                                    <div class="first-h">{{detailCount.viewProductCount}} 次</div>
                                    <div class="second-h">产品浏览</div>
                                </div>
                            </div>
                            <div class="service-item-box" v-if="detailCount.joinOnlineActCount > 0">
                                <div class="service-item has-pointer" @click="toAppPage('2', detailCount.joinOnlineActCount)" htmdEvt="customerActOn_btn">
                                    <div class="first-h">{{detailCount.joinOnlineActCount}} 次</div>
                                    <div class="second-h">线上活动</div>
                                </div>
                            </div>
                            <div class="service-item-box" v-if="detailCount.joinUnlineActCount > 0">
                                <div class="service-item has-pointer" @click="toAppPage('3', detailCount.joinUnlineActCount)" htmdEvt="customerActOff_btn">
                                    <div class="first-h">{{detailCount.joinUnlineActCount}} 次</div>
                                    <div class="second-h">线下活动</div>
                                </div>
                            </div>
                            <div class="service-item-box" v-if="detailCount.fourHundredCount > 0">
                                <div class="service-item has-pointer" @click="toAppPage('4', detailCount.fourHundredCount)" htmdEvt="customer400_btn">
                                    <div class="first-h">{{detailCount.fourHundredCount}} 次</div>
                                    <div class="second-h">400互动</div>
                                </div>
                            </div>
                            <div class="service-item-box" v-if="detailInfo.meetRecordCount > 0">
                                <div class="service-item has-pointer" @click="toAppPage('5', detailInfo.meetRecordCount)" htmdEvt="customerMeet_btn">
                                    <div class="first-h">{{detailInfo.meetRecordCount}} 次</div>
                                    <div class="second-h">约见</div>
                                </div>
                            </div>
                            <div class="service-item-box" v-if="detailCount.otherOperateCount > 0">
                                <div class="service-item has-pointer" @click="toAppPage('6', detailCount.otherOperateCount)" htmdEvt="customerOtherOperate_btn">
                                    <div class="first-h">{{detailCount.otherOperateCount}} 次</div>
                                    <div class="second-h">其他</div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 客户服务 -->
                <!--有产品状态-->
                <div class="item-block" v-if="AppointmentList.length !=0">
                    <div class="item-title border-bottom">客户服务</div>
                    <div class="item-container">
                        <div class="service" v-for="(aitem,index) in AppointmentList" :key="index">
                            <div class="service-title has-pointer" @click="toProjectDetail(aitem)" htmdEvt="clickProjectDetail_btn">{{aitem.projectName}}</div>
                            <div class="service-container">
                                <div class="service-order-item">
                                    <span class="icon-box" v-if="aitem.tradeType=='23'">
                                        <img class="img" src="../../../img/detailIcon/fail.png">
<!--                                        <i class="iconfont">&#xe658;</i>-->
                                    </span>
                                    <span class="icon-box" v-else>
                                        <img class="img" src="../../../img/detailIcon/success.png">
<!--                                        <i class="iconfont">&#xe658;</i>-->
                                    </span>
                                    {{returnTradeType(aitem.tradeType)}}<span class="date-style" style="font-weight: normal;">{{aitem.createTime}}</span>
                                </div>
                                <!-- <div class="service-link service-link-no has-pointer" @click="toStaticPage('1')">
                                    交易指引说明 <i class="iconfont">&#xe606;</i>
                                </div> -->
                                <div class="service-link service-link-no has-pointer" @click="toStaticPage('18')" htmdEvt="clickProbuy_btn">服务规范：产品认购 <i class="iconfont">&#xe606;</i></div>
                                <div class="service-link service-link-no has-pointer" @click="toStaticPage('19')" htmdEvt="clickVideo_btn">服务规范：视频双录及合同签署 <i class="iconfont">&#xe606;</i></div>
                            </div>
                        </div>
                    </div>
                </div>
                <!-- 注册步骤 -->
                <div class="item-block" v-if="cusType != 1 && (!detailInfo.hadRealName || !detailInfo.hadRiskTest || !detailInfo.hadQualifiedAuth) && AppointmentList.length ==0">
                    <div class="item-title border-bottom">客户服务</div>
                    <div class="item-container">
                        <!-- 注册步骤 -->
                        <div class="service-step-container">
                            <section class="stepWrapper">
                                <div class="steps-box">
                                    <div class="step-item step-left">
                                        <div class="step-main active-main" :class="{'active-main': !detailInfo.hadRegister}">待注册</div>
                                        <div class="step-style">
                                            <div class="step-icon" :class="{'active-icon': !detailInfo.hadRegister || detailInfo.hadRegister || detailInfo.hadRealName}"></div>
                                            <div class="step-line"></div>
                                        </div>
                                    </div>
                                    <div class="step-item step-center" >
                                        <div class="step-main" :class="{'active-main': detailInfo.hadRegister}">已注册</div>
                                        <div class="step-style" :class="{'active-style': detailInfo.hadRegister}">
                                            <div class="step-icon" :class="{'active-icon': detailInfo.hadRegister}"></div>
                                            <div class="step-line active-line"></div>
                                        </div>
                                    </div>
                                    <div class="step-item step-right">
                                        <div class="step-main" :class="{'active-main': detailInfo.hadRealName}">已实名认证</div>
                                        <div class="step-style" :class="{'active-style': detailInfo.hadRealName}">
                                            <div class="step-icon"></div>
                                            <div class="step-line"></div>
                                        </div>
                                    </div>
                                </div>
                            </section>
                            <div class="service-step">
                                <!-- 未注册 -->
                                <div class="step-link" v-if="!detailInfo.hadRegister">
                                    <div class="next-step-style">下一步动作：引导用户注册</div>
                                    <div class="guide-style">动作指引：</div>
                                    <!-- <div class="has-pointer" @click="toStaticPage('11')">用户注册的方法说明 <i class="iconfont">&#xe606;</i></div> -->
                                    <div class="has-pointer" @click="toStaticPage('12')" htmdEvt="clickGuide_btn">服务规范：引导注册 <i class="iconfont">&#xe606;</i></div>
                                </div>
                                <!-- 已注册 -->
                                <div class="step-link" v-if="detailInfo.hadRegister && !detailInfo.hadRealName">
                                    <div class="next-step-style">下一步动作：引导实名认证</div>
                                    <!-- <div class="guide-style">动作指引：</div>
                                    <div class="has-pointer" @click="toStaticPage('13')">实名认证的方法说明 <i class="iconfont">&#xe606;</i></div>
                                    <div class="has-pointer" @click="toStaticPage('14')">风险测评的方法说明 <i class="iconfont">&#xe606;</i></div> -->
                                </div>
                                <!-- 已实名认证 -->
                                <!-- <div class="step-link" v-if="detailInfo.hadRegister && detailInfo.hadRealName &&  !detailInfo.hadQualifiedAuth || detailInfo.hadRegister && detailInfo.hadRealName && !detailInfo.hadMajorAuth">
                                    <div class="next-step-style">下一步动作：合格投资者认证</div>
                                    <div class="guide-style">动作指引：</div> -->
                                    <!-- <div class="has-pointer" @click="toStaticPage('15')">合格投资者认证说明 <i class="iconfont">&#xe606;</i></div> -->
                                    <!-- <div class="has-pointer" @click="toStaticPage('16')">服务规范：投资者适当性 <i class="iconfont">&#xe606;</i></div>
                                    <div class="has-pointer" @click="toStaticPage('17')">服务规范：产品推荐 <i class="iconfont">&#xe606;</i></div>
                                </div> -->
                                <!-- 已经完成实名认证的状态 -->
                                <div class="step-link" v-if="detailInfo.hadRealName">
                                    <div class="next-step-style">下一步动作：引导做合格投资者认证及风险测评</div>
                                    <!-- <div class="guide-style">动作指引：</div>
                                    <div class="has-pointer" @click="toStaticPage('15')" htmdEvt="clickQualified_btn">合格投资者认证说明 <i class="iconfont">&#xe606;</i></div>
                                    <div class="has-pointer" @click="toStaticPage('14')" htmdEvt="clickEvaluation_btn">风险测评的方法说明 <i class="iconfont">&#xe606;</i></div> -->
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 客户完成交易准备状态 -->
                <div class="item-block" v-if="detailInfo.hadRealName && detailInfo.hadRiskTest && detailInfo.hadQualifiedAuth && AppointmentList.length == 0 && cusType != 1">
                    <div class="item-title border-bottom">客户服务</div>
                    <div class="item-container">
                        <div class="service" v-if="AppointmentList.length ==0 && detailInfo.hadRealName && detailInfo.hadRiskTest && detailInfo.hadQualifiedAuth">
                            <div class="service-title has-pointer">客户已完成交易前准备</div>
                            <div class="service-container">
                                <div class="service-order-item" style="font-weight: normal;color: #666687;">
                                    <p>动作指引：</p>
                                    <p>客户已完成交易前的准备，成交意向基本明确，建议多跟进分享产品相关资讯给客户，引导客户选择合适产品。</p>
                                </div>
                                <div class="step-link">
                                <!-- <div class="has-pointer" @click="toStaticPage('18')">服务规范：产品认购 <i class="iconfont">&#xe606;</i></div> -->
                                <!-- <div class="has-pointer" @click="toStaticPage('19')">服务规范：视频双录及合同签署 <i class="iconfont">&#xe606;</i></div> -->
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- 展业加油站 -->
                <div class="item-block">
                    <div class="item-title border-bottom">展业加油站</div>
                    <div class="item-container">
                        <!-- 产品建议 -->
                        <div class="service-station-item has-pointer" v-if="cusType != 2 && detailInfo.hadRiskTest" @click="toAppPage('7', detailCount.recommendProCount)" htmdEvt="customerProductSug_btn">
                            <div class="service-station-item-title" >
                                产品建议
                            </div>
                            <div class="service-station-item-text">
                                可推荐该客户<span>{{detailCount.recommendProCount || '0'}}</span>款产品
                            </div>
                        </div>
                        <!-- 跟进 -->
                        <div class="service-station-item has-pointer" @click="toAppPage('8', detailCount.interestArtCount)" htmdEvt="customerInterestArt_btn">
                            <div class="service-station-item-title">
                                跟进
                            </div>
                            <div class="service-station-item-text">
                                推荐Ta可能会感兴趣的文章<span>{{detailCount.interestArtCount || '0'}}</span>篇
                            </div>
                        </div>
                        <!-- 邀约见面 -->
                        <div class="service-station-item has-pointer" @click="toAppPage('9', detailCount.unActiCount)" v-if="cusType != 1" htmdEvt="customerUnActi_btn">
                            <div class="service-station-item-title">
                                邀约见面
                            </div>
                            <div class="service-station-item-text">
                                可邀约活动<span>{{detailCount.unActiCount || '0'}}</span>个
                            </div>
                        </div>
                        <!-- 转介绍 -->
                        <div class="service-station-item has-pointer" @click="toAppPage('10', detailCount.onActiCount)" v-if="cusType == 1" htmdEvt="customerOnActiCount_btn">
                            <div class="service-station-item-title">
                                转介绍
                            </div>
                            <div class="service-station-item-text">
                                适合转介绍的活动<span>{{detailCount.onActiCount || '0'}}</span>个
                            </div>
                        </div>
                        <!-- 资产配置 -->
                        <div class="service-station-item has-pointer" v-if="detailInfo.assetConfig" @click="toAppPage2('2')" htmdEvt="customerCanConfig_btn">
                            <div class="service-station-item-title">
                                    资产配置
                            </div>
                            <div class="service-station-item-text">
                                    可配置资产 {{detailInfo.canConfigAssets}} 万元
                                    <span v-if="detailInfo.lifeTerm==1">单身期</span>
                                    <span v-if="detailInfo.lifeTerm==2">家庭形成期</span>
                                    <span v-if="detailInfo.lifeTerm==3">家庭成长期</span>
                                    <span v-if="detailInfo.lifeTerm==4">家庭成熟期</span>
                                    <span v-if="detailInfo.lifeTerm==5">老年期</span>
                            </div>
                        </div>
                        <div class="service-station-item has-pointer"  v-else @click="toAppPage2('1')" htmdEvt="customerCanConfigNo_btn">
                            <div class="service-station-item-title">
                                资产配置
                            </div>
                            <div class="service-station-item-text">
                                填写问题，精准定位客户画像
                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </mt-loadmore>
         <!-- 辅助工具 -->
            <div class="tools-box">
                <div class="tools-container">
                    <!-- <div class="tools-title">
                        辅助工具
                    </div> -->
                    <div class="tools-btn-box" :class="{ 'show-more-tools': isActive }" >
                        <button type="button" class="tools-btn has-pointer" v-for="(btnItem,index) in btnList" :key="index" htmdEvt="btnItem.btnNam" @click="toToolsPage(btnItem)">{{btnItem.msg}}</button>
                    </div>
                    <!-- <div class="tools-toggle-btn has-pointer" @click="showMoreBtn"  v-if="btnList.length > 3">
                        <i class="iconfont" v-if="isActive">&#xe640;</i>
                        <i class="iconfont" v-else>&#xe645;</i>
                    </div> -->
                </div>

            </div>
            <!-- 提示 -->
            <div class="mask" v-if="showTip">
                <div class="tip-box">
                    <div class="tip-box-container">
                        <div class="tip-box-title">
                            <div class="tip-box-item border-bottom">
                                <div class="tip-left border-right">
                                    <div class="first-col" style="color: #141C30">客户标识</div>
                                </div>
                                <div class="tip-right" style="width:100%">
                                    <div class="common-col text-center" style="color: #141C30">产生条件</div>
                                </div>
                            </div>
                        </div>
                        <div class="tip-box-body">
                            <div class="tip-box-item border-bottom">
                                <div class="tip-left border-right">
                                    <div class="first-col">高关注</div>
                                </div>
                                <div class="tip-right">15天内有浏览产品信息超过3条的客户</div>
                            </div>
                            <div class="tip-box-item border-bottom">
                                <div class="tip-left border-right"><div class="first-col">高互动</div></div>
                                <div class="tip-right">30天内有客户互动超过5条的</div>
                            </div>
                            <div class="tip-box-item border-bottom">
                                <div class="tip-left border-right"><div class="first-col">低互动</div></div>
                                <div class="tip-right">有跟踪或互动且最新记录比当前时间大于365天</div>
                            </div>
                            <div class="tip-box-item border-bottom">
                                <div class="tip-left border-right"><div class="first-col">无互动</div></div>
                                <div class="tip-right">创建时间大于365天且无跟踪无互动的客户</div>
                            </div>
                            <div class="tip-box-item border-bottom">
                                <div class="tip-left border-right"><div class="first-col">无效客户</div></div>
                                <div class="tip-right">统一客户及跟踪记录里面均没有手机号码的客户</div>
                            </div>
                        </div>
                        <div class="tip-box-footer">
                            <button type="button" class="tip-button" @click="closeTip" htmdEvt="clicknow_btn">我知道了</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="labelMask" v-if="labelShow">
                <div class="labelBlock">
                    <div class="title">
                        <p>标签管理</p>
                        <img class="has-pointer" src="../../../img/detailIcon/closeLabel.png" @click="closeBlock" htmdEvt="clickCloseLabel_btn">
                    </div>
                    <div class="contentBlock">
                        <p class="checkLabel">已选标签</p>
                        <div class="checkList">
                            <p class="has-pointer" v-for="(item,index) in checkList" :key="index" @click="cancelLabel(index)" htmdEvt="clickCancelLabel_btn">
                                {{item}}
                            </p>
                        </div>

                        <p class="moreLabel">更多标签</p>
                        <div class="moreList">
                            <p class="has-pointer" v-for="(item,index) in chooseList" :key="index" @click="addLabel(index)" htmdEvt="clickAddLabel_btn">
                                {{item}}
                            </p>
                        </div>
                    </div>
                    <div class="confirm has-pointer" @click="submitLabel" htmdEvt="clickSubmitLabel_btn">
                        <p>确定</p>
                    </div>
                </div>
            </div>
    </div>
</template>

<script  type="text/javascript">
// var getAppParam = null
// window.getAppParams = function (appparams) {
//     getAppParam = appparams
//     console.log(getAppParam)
//     console.log("=====customerId===")
//     console.log(getAppParam.customerId)
//  }
window.FromAppRefresh = function (statusCode) {
    getVueMethod();
}
import "./detail.less";
// import "./detail.js";
// import loading from '@src/common/loading/loading';
// import tipAction from '@common/components/otherComponents/tipAction/tipAction'
import popText from '@src/common/popText/popText.vue'
// import splitUrl from "@common/js/splitUrl.js";
const ModalHelper = (function(bodyCls){
      var scrollTop;
      return{

          afterOpen:function(){

              scrollTop = document.scrollingElement.scrollTop;

              document.body.classList.add(bodyCls);

              document.body.style.top = -scrollTop+'px';

          },

          beforeClose:function(){

              document.body.classList.remove(bodyCls);

              document.scrollingElement.scrollTop = scrollTop;

          }

      }

  })('modal-open');
export default {
    name: "detail",
    components:{
        // loading,
		popText
    },
    data() {
        return {
            // lsf:['FOT','无','无户','无','无效联系方式','无效客户哈哈你在吗','无效客户','无效客户','无效客户','无效客户','无效客户','无效客户','无效客户','无效客户','无效客户','无效客户','无效客户','无效客户','无效客户','无效客户','无效客户'],
            isActive: false,
            customerSource: '', // 客户来源，区分统一和跟踪客户
            memberId: '', //活动id
            detailInfo: {},
            detailCount: {},
            AppointmentList: [],
            popShow: false,
            taskId: '',
            popText: '',
            showLoading: true,
            showTip: false,
            btnList:[],
            customerId: null,
            lgbCustomerNo: null,
            ctype: null,
            aOfFunds: '1000',
            pOfFunds: '10000',
            lastTime: '2019-10-10',
            cstatus: 2,
            cstatus2: 3,
            activeClass: false,
            showBlock: true,
            paramsFy: {},
            cusType: '', // 客户类型
            isDeal: '', //是否在交易中
            isMeetRecordCount: true,
            // 天津大区
            isFlag:2,
            // 天津大区 标签块显示
            showLabel:false,
            // 显示标签窗
            labelShow:false,
            // 所有标签
            allLabels:[],
            // 当前 标签列表
            nowLabels:[],
            // 选中 标签列表
            checkList:[],
            // 可选 标签列表
            chooseList:[],
            isIos: false,
            showType5:null // 待跟踪客户展示那种客户服务4、待注册，2、交易中
        };
    },
    created(){
        // this.cstatus = 5
         let deUrl = decodeURI(window.location.href);
        // 客户编号
        if (splitUrl(deUrl)['customerId'] == '--') {
            this.customerId = null;
        } else {
            this.customerId = splitUrl(deUrl)['customerId']
        }
        // 客户类型
        this.customerSource = splitUrl(deUrl)['customerSource']

        // 任务详情传过来的成员id
        this.memberId = splitUrl()['memberId']
        // 任务详情传过来的taskid
        var tempTaskId = decodeURIComponent(splitUrl()['taskId']);
        this.taskId = tempTaskId.indexOf('?') >=0 ? tempTaskId.split('?')[0] : tempTaskId
        // let tempStatus = splitUrl(deUrl)['cstatus'];
        // if (tempStatus !== '--'){
        //     let statusArr = tempStatus.split(',');
        //     if (statusArr.includes('3')) {
        //         this.cstatus = 3
        //     } else if (statusArr.includes('2'))  {
        //         this.cstatus = 2
        //     } else if (statusArr.includes('5')){
        //         this.cstatus = 5
        //     } else if (statusArr.includes('4')){
        //         this.cstatus = 4
        //     }
        //     if (tabFlag && tabFlag==2) {
        //         this.cstatus = 2
        //     }
        // } else {
        //     this.cstatus = 0
        // }
        // this.cstatus = splitUrl()['cstatus'];
        // let tempType = decodeURI(splitUrl()['ctype']);
        // let tempType = splitUrl(deUrl)['ctype'];
        //  if (tempType != '--'){
        //     this.ctype = tempType.split(',');
        //  } else {
        //      this.ctype = []
        //  }
        // --------
        //  this.btnList = [
        //     {msg:'立即预约', btnNam: 'customerMMeet_btn'},
        //     {msg:'编辑资料', btnNam: 'customerEditInfo_btn'},
        //     {msg:'添加日程', btnNam: 'customerAddR_btn'},
        //     {msg:'添加跟踪记录', btnNam: 'customerAddTR_btn'}
        // ]

        // 辅助工具（交易中，待续签）
        // if (this.cstatus == 2 || this.cstatus == 3) {
        //     this.btnList = [
        //         {msg:'立即预约', btnNam: 'customerMMeet_btn'},
        //         // {msg:'编辑资料', btnNam: 'customerEditInfo_btn'},
        //         {msg:'添加日程', btnNam: 'customerAddR_btn'},
        //         {msg:'添加跟踪记录', btnNam: 'customerAddTR_btn'},

        //     ]
        // } else if (this.cstatus == 1) {
        //     if (this.lgbCustomerNo) {
        //         this.btnList = [
        //             {msg:'添加日程', btnNam: 'customerAddR_btn'},
        //             {msg:'添加跟踪记录', btnNam: 'customerAddTR_btn'}
        //         ]
        //     } else {
        //         this.btnList = [
        //             {msg:'编辑资料', btnNam: 'customerVisRegiter_btn'},
        //             {msg:'邀请注册', btnNam: 'customerEditInfo_btn'},
        //             {msg:'添加日程', btnNam: 'customerAddR_btn'},
        //             {msg:'添加跟踪记录', btnNam: 'customerAddTR_btn'}
        //         ]
        //     }

        // }
         this.initData()
    },
    mounted () {
        // window.getVueMethod = this.initData;
        // window.getVueMethod = this.setTOGetAppMethod;
        window.getVueMethod = this.notRefreshPage;
        if(window.appIsIOS){
            // 代表是ios手机
            this.isIos = true
        }else{
            // 代表是安卓手机
            this.isIos = false
        }
    },
    methods: {
        // 跳转预约查询
        toOrderIntension(){
            if(this.isIos){
              window.webkit.messageHandlers.openOrderIntension.postMessage({})
            }else{
              window.jsObj.openOrderIntension()
            }

        },
        notRefreshPage(){
            console.log('not refresh')
        },
        // 跳转通话记录列表页
        toHpage() {
           let params = {
               customerNo: this.detailInfo.customerNo,
               customerType: this.detailInfo.customerStatus
           }
           if(this.isIos){
              window.webkit.messageHandlers.gotoCallPage.postMessage(JSON.stringify(params))
           }else{
              window.jsObj.gotoCallPage(JSON.stringify(params))
           }

        },
         // 拨打电话新增参数（兼容ios13）
        callPhone(phone){
            let obj= {
                mobile:phone,
                customNu: this.detailInfo.customerNo,
                customResource: this.detailInfo.customerStatus,
                memberId: this.memberId,
                taskId: this.taskId
            }
            if(this.isIos){
               window.webkit.messageHandlers.toSaveAndTakePhone.postMessage(JSON.stringify(obj))
            }else{
               window.jsObj.toSaveAndTakePhone(JSON.stringify(obj))
            }
        },
         // 下拉刷新
        loadTop() {
            // 加载更多数据
            this.$refs.loadmore.onTopLoaded();
            this.initData();
        },
        setTOGetAppMethod (){
            setTimeout(()=>{
                console.log("test1111")
                this.initData()
            },1000)
             console.log("test2222")
        },
        // 初始化数据
        initData() {
            let that = this;
            that.getCount();
            let data = {customerNo: that.customerId}
            if(that.customerSource){
                data.customerSource = that.customerSource;
            }
            let tempStr = null;
            this.$axiosHttp.http({
                    name:'',
                    url: apiUrl.getCustomerInfoByID,
                    needFailCallback: true,
                    method: 'POST',
                    // params: {
                    //     customerNo: that.customerId,
                    //     // customerNo: 305159, // 待跟踪
                    //     // customerNo:550902,  //待交易
                    //     // customerNo: 464951, // 交易中
                    //     // customerNo: 463602, // 待续签
                    //     // customerNo: 485167,
                    //     customerSource: that.customerSource,
                    //     // customerSource: 1,
                    // },
                    params: data,

            }, (res) => {
                let data = res.data.data;
                this.detailInfo = data;
                this.showLoading = false;
                // 判断天津大区 是否展示标签及选取功能
                this.isFlag=res.data.isFlag
                // debugger
                this.getNowLabel(1)

                // let statusArr = data.custTypeList.split(',')
                console.log('.......',data.custTypeList)
                this.cusType = data.customerDealStatus
                // if(data.custTypeList.includes('5')){
                //     this.cusType = 5
                // }else if(data.custTypeList.includes('2')){
                //     this.isDeal = 2
                // }else if(data.custTypeList.includes('3')){
                //      this.cusType = 3
                // }else if(data.custTypeList.includes('4')){
                //      this.cusType = 4
                // }
                console.log('11111',data.meetRecordCount)
                this.isMeetRecordCount = data.meetRecordCount > 0 ? true : false;
                // 获取用户常用资料
                if (that.cusType != 2) {
                    that.getAppointmentData();
                }
                // ‘待交易’用户展示那种客户服务,已风测已合格认证展示‘交易中’客户服务，否则展示‘待跟踪’
                // if(that.cstatus == 5){
                //     this.showType5 = this.detailInfo.hadRiskTest && this.detailInfo.hadQualifiedAuth ? 2 : 4
                // }
                let hiddenObj = {};
                if (data.customerStatus == 'TC') {
                    hiddenObj = {
                        customerId: data.customerNo,
                        customerStatus: 2
                    }
                    // 辅助工具按钮列表
                    that.btnList = [
                        {msg:'编辑资料', btnNam: 'customerEditInfo_btn'},
                        {msg:'添加日程', btnNam: 'customerAddR_btn'},
                        {msg:'添加跟踪记录', btnNam: 'customerAddTR_btn'},
                        {msg:'录跟进（新员工）'}
                    ]
                } else {
                    hiddenObj = {
                        customerId: data.customerNo,
                        customerStatus: 1

                    }
                    that.btnList = [
                        {msg:'立即预约', btnNam: 'customerVisRegiter_btn'},
                        // {msg:'邀请注册', btnNam: 'customerEditInfo_btn'},
                        {msg:'添加日程', btnNam: 'customerAddR_btn'},
                        {msg:'添加跟踪记录', btnNam: 'customerAddTR_btn'},
                        {msg:'录跟进（新员工）'}
                    ]
                }

                let obj = {
                    customerId: this.detailInfo.customerNo,
                    customerType: this.detailInfo.customerType,
                    customerStatus: this.detailInfo.customerStatus
                }
                if(this.isIos){
                    // 给原生传递数据，原生拿到参数请求接口获取关键数据以供使用
                   window.webkit.messageHandlers.getParamsToApp.postMessage(JSON.stringify(obj))
                   // 给原生传递关键参数，用于实现隐藏客户功能
                   window.webkit.messageHandlers.forAppHiddenCustomer.postMessage(JSON.stringify(hiddenObj))
                }else{
                   window.jsObj.getParamsToApp(JSON.stringify(obj))
                   window.jsObj.forAppHiddenCustomer(JSON.stringify(hiddenObj))
                }

                // this.showNoData = false;
            },res => {
                if(res.data.status == "1000") {
                    this.showLoading = true;
                    this.detailInfo = {};
                    // tipAction(res.data.message);
                } else {
                    // tipAction(res.data.message);
                }
            });
        },
        // 跳转到营销活动详情页
        jumpMarketingActivitiesDetail(activityId){
            let params = {activityId : activityId,customerId: this.detailInfo.customerNo}
            if (this.isIos) {
                window.webkit.messageHandlers.gotoMarketingActivityDetail.postMessage(JSON.stringify(params))
            } else {
                window.jsObj.gotoMarketingActivityDetail(JSON.stringify(params))
            }
        },
        // 跳转到项目详情，主要客户服务中有排队中的产品时使用
        toProjectDetail (item) {
            console.log(item)
            let obj= {
                projectId:item.projectId,
                productType: item.salesType
            }
            if(this.isIos){
               window.webkit.messageHandlers.gotoProdetail.postMessage(JSON.stringify(obj))
            }else{
               window.jsObj.gotoProdetail(JSON.stringify(obj))
            }

        },
        // 交易产品列表
        getAppointmentData () {
            if (this.customerId) {
                this.$axiosHttp.http({
                    name:'',
                    url: apiUrl.appointmentListApi,
                    needFailCallback: true,
                    method: 'POST',
                    params: {
                        customerNo: this.customerId,
                    },

                    }, (res) => {
                        this.AppointmentList = res.data.data
                    },res => {
                        console.log(res.data)
                });

            }
        },
        // 获取统计数据
        getCount () {
             this.$axiosHttp.http({
                    name:'',
                    url: apiUrl.getCustomerInfoCount,
                    needFailCallback: true,
                    method: 'POST',
                    params: {
                        customerNo: this.customerSource == 2 ? null : this.customerId
                    },
            }, (res) => {
                console.log("====1111111count=====")
                this.detailCount = res.data.data
                if (this.detailCount.viewProductCount > 0 || this.detailCount.joinOnlineActCount > 0 || this.detailCount.joinUnlineActCount > 0 || this.detailCount.fourHundredCount > 0 || this.detailCount.otherOperateCount > 0) {
                    this.showBlock = true;
                } else {
                    this.showBlock = false;

                }
            },res => {
                console.log("====2222coun=====")
                console.log(res.data)

            });
        },
        // 是否显示客户意向整块
        // showBlockEvent () {
        //     if (this.detailCount.viewProductCount == 0 && this.detailCount.joinOnlineActCount && this.detailCount.joinUnlineActCount && this.detailCount.fourHundredCount && this.detailCount.meetRecordCount && this.detailCount.otherOperateCount) {
        //         this.showBlock = false
        //     }
        // },
        // 返回产品状态
        returnTradeType (item) {
            if (item === 0) {
                return '待确认'
            }else if (item === 1) {
                return '排队中'
            } else if (item === 2) {
                return '排队成功'
            } else if (item === 3) {
                return '到账中'
            } else if (item === 4) {
                return '已到账'
            } else if (item === 5) {
                return '预约成功'
            } else if (item === 21) {
                return '已撤销'
            } else if (item === 22) {
                return '已过期'
            } else if (item === 23) {
                return '预约失败'
            }
        },
        //活跃程度
        transformCustomerType (item) {
            if (item.includes('高互动')) {
                return 'item-label-blue'
            } else if (item.includes('高关注')) {
                return 'item-label-orange'
            } else if (item.includes('无互动')) {
                return 'item-label-darkBlue'
            } else if (item.includes('低互动')) {
                return 'item-label-light-brown'
            } else {
                return 'item-label-gray'
            }
        },
        // 常用联系方式
        toAnother (str, pparam) {
            let obj = {
                customerId: this.detailInfo.customerNo
            }
            // if (pparam) {
                if (str === '1') {
                    // 这里是跳转到联系方式
                    obj = {
                        customerId: this.detailInfo.customerNo,
                        mobileInternet: this.detailInfo.mobileInternet,
                        bankPhones: this.detailInfo.bankPhones,
                        phone: this.detailInfo.phone,
                        customResource: this.detailInfo.customerStatus,
                        memberId: this.memberId,
                        taskId: this.taskId
                    }
                    if(this.isIos){
                       window.webkit.messageHandlers.gotoContact.postMessage(JSON.stringify(obj))
                    }else{
                       window.jsObj.gotoContact(JSON.stringify(obj))
                    }
                } else if (str === '2') {
                    // 这里是跳转到银行卡信息
                    obj = {
                        customerId: this.detailInfo.customerNo,
                        phone: this.detailInfo.phone,
                        customerType: this.detailInfo.customerType,
                    }
                    if(this.isIos){
                       window.webkit.messageHandlers.gotoBankInfo.postMessage(JSON.stringify(obj))
                    }else{
                       window.jsObj.gotoBankInfo(JSON.stringify(obj))
                    }

                }else if (str === '3') {
                    // 这里是跳转到客户持仓
                    obj = {
                       customerId: this.detailInfo.customerNo,
                       customerType: this.detailInfo.customerType,
                    }
                    if(this.isIos){
                       window.webkit.messageHandlers.gotoHoldShares.postMessage(JSON.stringify(obj))
                    }else{
                       window.jsObj.gotoHoldShares(JSON.stringify(obj))
                    }

                }else if (str === '4') {
                    // 这里是跳转到交易流水
                    if(this.isIos){
                       window.webkit.messageHandlers.gotoDealWater.postMessage(JSON.stringify(obj))
                    }else{
                       window.jsObj.gotoDealWater(JSON.stringify(obj))
                    }
                } else if (str === '5') {
                    // 这里是跳转到客户资料
                    obj = {
                        customerId: this.detailInfo.customerNo,
                        customerName:this.detailInfo.customerName,
                        customerStatus: this.detailInfo.customerStatus,
                        dealStatus: this.detailInfo.dealStatus,
                        customerType: this.detailInfo.customerType
                    }
                    if(this.isIos){
                        window.webkit.messageHandlers.gotoCustomerInfo.postMessage(JSON.stringify(obj))
                    }else{
                        window.jsObj.gotoCustomerInfo(JSON.stringify(obj))
                    }

                }else if(str === '6'){
                    // 这里是跳转到风测及认证页面
                    obj = {
                        // url: this.detailInfo.customerNo,
                        url: window.location.origin+'/lgbCdn/customerCenter/riskAuthentication/riskAuthentication.html?customerId='+this.detailInfo.customerNo+'&isSkip=1',
                    }
                    if(this.isIos){
                        window.webkit.messageHandlers.jumpPageWithObj.postMessage(JSON.stringify(obj))
                    }else{
                        window.jsObj.jumpPageWithObj(JSON.stringify(obj))
                    }
                    // this.customerId
                    // this.$router.push({path: '/lgbCdn/customerCenter/detail/riskAuthentication.html',query:{customerId:296211}})
                }else if(str === '7'){
                    // 这里是跳转到老带新页面
                    obj = {
                        // customerId: this.detailInfo.customerNo,
                        url: window.location.origin+'/lgbCdn/customerCenter/oldBringsNewChain/oldBringsNewChain.html?customerId='+this.detailInfo.customerNo+'&isSkip=1',
                    }
                    if(this.isIos){
                        window.webkit.messageHandlers.jumpPageWithObj.postMessage(JSON.stringify(obj))
                    }else{
                        window.jsObj.jumpPageWithObj(JSON.stringify(obj))
                    }
                    // this.$router.push({path: '/lgbCdn/customerCenter/detail/oldBringsNewChain.html',query:{customerId:622358}})
                }
            // }
        },
        // 资金量
        // toFinacingVolume () {
        //     let params = {
        //         customerId: this.detailInfo.customerNo
        //     }
        //     window.jsObj.gotoFundsReceived(JSON.stringify(params))
        //     // if (pVal && pVal !== '--') {

        //     // } else {
        //     //     tipAction('无相关数据');
        //     // }
        // },
        // 跳转静态页面,主要是客户服务中的静态说明页跳转
        toStaticPage (str) {
            let params = {
                id: str
            }
            if(this.isIos){
              window.webkit.messageHandlers.gotoStaticPage.postMessage(JSON.stringify(params))
            }else{
              window.jsObj.gotoStaticPage(JSON.stringify(params))
            }

        },
        // 加油站,客户意向
        toAppPage (str) {
            let  params = {
                customerId: this.detailInfo.customerNo
            }
            if (str === '1') {
                // 跳转到产品浏览页
                   if(this.isIos){
                       window.webkit.messageHandlers.gotoBrowsingPage.postMessage(JSON.stringify(params))
                   }else{
                       window.jsObj.gotoBrowsingPage(JSON.stringify(params))
                   }
                } else if (str === '2') {
                    // 跳转到线上活动
                    if(this.isIos){
                        window.webkit.messageHandlers.gotoOnlineEvent.postMessage(JSON.stringify(params))
                    }else{
                        window.jsObj.gotoOnlineEvent(JSON.stringify(params))
                    }

                } else if (str === '3') {
                    // 跳转到线下活动
                    if(this.isIos){
                        window.webkit.messageHandlers.gotoOfflineEvent.postMessage(JSON.stringify(params))
                    }else{
                        window.jsObj.gotoOfflineEvent(JSON.stringify(params))
                    }

                } else if (str === '4') {
                    // 跳转到400互动
                    if(this.isIos){
                        window.webkit.messageHandlers.goto400Interact.postMessage(JSON.stringify(params))
                    }else{
                        window.jsObj.goto400Interact(JSON.stringify(params))
                    }

                } else if (str === '5') {
                    // 跳转到约见
                    if (this.detailInfo.customerStatus=='TC') {
                        params = {
                            customerId: this.detailInfo.customerNo,
                            customerStatus: 'TC'
                        }
                    } else {
                        params = {
                            customerId: this.detailInfo.customerNo,
                            customerStatus: '1'
                        }
                    }
                    if(this.isIos){
                        window.webkit.messageHandlers.gotoAppointmentList.postMessage(JSON.stringify(params))
                    }else{
                        window.jsObj.gotoAppointmentList(JSON.stringify(params))
                    }

                } else if (str === '6') {
                    if (this.isIos) {
                        window.webkit.messageHandlers.gotoOtherListPage.postMessage(JSON.stringify(params))
                    } else {
                        window.jsObj.gotoOtherListPage(JSON.stringify(params))
                    }

                } else if (str === '7') {
                    // 跳转到展业加油站产品建议
                     params = {
                        customerId: this.detailInfo.customerNo,
                        customerStatus: this.detailInfo.customerStatus,
                        dealStatus: this.detailInfo.dealStatus,
                        customerType: this.detailInfo.customerType
                    }
                    if(this.isIos){
                        window.webkit.messageHandlers.gotoSuggestionPage.postMessage(JSON.stringify(params))
                    }else{
                        window.jsObj.gotoSuggestionPage(JSON.stringify(params))
                    }

                } else if (str === '8') {
                    // 跳转到展业加油站跟进
                    if (this.isIos) {
                        window.webkit.messageHandlers.gotoFollowUp.postMessage(JSON.stringify(params))
                    } else {
                        window.jsObj.gotoFollowUp(JSON.stringify(params))
                    }


                } else if (str === '9') {
                    // 邀约见面跳转
                    if(this.isIos){
                        window.webkit.messageHandlers.gotoInvitation.postMessage(JSON.stringify(params))
                    }else{
                        window.jsObj.gotoInvitation(JSON.stringify(params))
                    }

                } else if (str === '10') {
                    // 转介绍的活动
                    if(this.isIos){
                        window.webkit.messageHandlers.gotoShareIntroductionl.postMessage(JSON.stringify(params))
                    }else{
                        window.jsObj.gotoShareIntroductionl(JSON.stringify(params))
                    }


                } else if (str === '11') {
                    // 页面顶部跟踪记录
                    params = {
                        customerId: this.detailInfo.customerNo,
                        customerName: this.detailInfo.customerName,
                        customerStatus: this.detailInfo.customerStatus,
                        dealStatus: this.detailInfo.dealStatus,
                        customerType: this.detailInfo.customerType
                    }
                    if(this.isIos){
                        window.webkit.messageHandlers.gotoTraceRecord.postMessage(JSON.stringify(params))
                    }else{
                        window.jsObj.gotoTraceRecord(JSON.stringify(params))
                    }

                }
            // if (pVal && pVal !== 0) {
            // } else {
            //     tipAction('无相关数据');
            // }
        },
        toAppPage2 (str) {
            let  params = {}
            if (str == '1') {
                // 展业加油站资产配置跳转（无资产配置id时）
                params = {
                    customerId: this.detailInfo.customerNo,
                    customerStatus:this.detailInfo.customerStatus,
                    type:'edit'
                }
                if(this.isIos){
                    window.webkit.messageHandlers.gotoTAA.postMessage(JSON.stringify(params))
                }else{
                    window.jsObj.gotoTAA(JSON.stringify(params))
                }

            } else {
                if (this.detailInfo.assetConfig) {
                    // 展业加油站有资产配置id
                    params = {
                        customerId: this.detailInfo.customerNo,
                        assetConfigId: this.detailInfo.assetConfig,
                        customerName:this.detailInfo.customerName,
                    }
                    if(this.isIos){
                        window.webkit.messageHandlers.gotoCheckReport.postMessage(JSON.stringify(params))
                    }else{
                        window.jsObj.gotoCheckReport(JSON.stringify(params))
                    }

                } else {
                    params = {
                        customerId: this.detailInfo.customerNo,
                        customerStatus:this.detailInfo.customerStatus,
                        type:'edit'
                    }
                    if(this.isIos){
                        window.webkit.messageHandlers.gotoTAA.postMessage(JSON.stringify(params))
                    }else{
                        window.jsObj.gotoTAA(JSON.stringify(params))
                    }

                }
            }
        },
        // 跳转原生的详情页面
        toToolsPage (item) {
            let  params = {
                customerId: this.detailInfo.customerNo
            }
            if (item.msg === '编辑资料') {
                if (this.isIos) {
                    window.webkit.messageHandlers.gotoEditInfo.postMessage(JSON.stringify(params))
                } else {
                   window.jsObj.gotoEditInfo(JSON.stringify(params))
                }

            } else if (item.msg === '添加日程') {
                params = {
                    customerId: this.detailInfo.customerNo,
                    customerName: this.detailInfo.customerName,
                    customerStatus: this.detailInfo.customerStatus,
                    customerType: this.detailInfo.customerType
                }
                if (this.isIos) {
                    window.webkit.messageHandlers.gotoAddSchedule.postMessage(JSON.stringify(params))
                } else {
                    window.jsObj.gotoAddSchedule(JSON.stringify(params))
                }

            } else if (item.msg === '添加跟踪记录') {
                params = {
                    customerId: this.detailInfo.customerNo,
                    customerName: this.detailInfo.customerName,
                    customerStatus: this.detailInfo.customerStatus,
                    customerType:this.detailInfo.customerType, // 客户类型：0-机构；1-个人；2-产品
                }
                if(this.isIos){
                    window.webkit.messageHandlers.gotoAddTraceRecord.postMessage(JSON.stringify(params))
                }else{
                    window.jsObj.gotoAddTraceRecord(JSON.stringify(params))
                }

            } else if (item.msg === '立即预约') {
                params = {
                    customerId: this.detailInfo.customerNo,
                    customerType:this.detailInfo.customerType, // 客户类型：0-机构；1-个人；2-产品
                }
                if(this.isIos){
                    window.webkit.messageHandlers.gotoImmediateAppointment.postMessage(JSON.stringify(params))
                }else{
                    window.jsObj.gotoImmediateAppointment(JSON.stringify(params))
                }

            }  else if (item.msg === '邀请注册') {
                if (this.isIos) {
                    window.webkit.messageHandlers.goRegister.postMessage(JSON.stringify(params))
                } else {
                    window.jsObj.goRegister(JSON.stringify(params))
                }

            } else if (item.msg === '业务直连') {
                let  params = {
                 id: 1
                }
                if (this.isIos) {
                    window.webkit.messageHandlers.gotoStaticPage.postMessage(JSON.stringify(params))
                } else {
                    window.jsObj.gotoStaticPage(JSON.stringify(params))
                }

            } else if (item.msg === '录跟进（新员工）') {
                let params = {
                    customerNo: this.detailInfo.customerNo,
                    customerSource: this.detailInfo.customerStatus=='TC'?2:1,
                    customerName:this.detailInfo.customerName
                }
                if (this.isIos) {
                    window.webkit.messageHandlers.gotoRecordKeep.postMessage(JSON.stringify(params))
                } else {
                    window.jsObj.gotoRecordKeep(JSON.stringify(params))
                }

            }
        },
        // 辅助工具显示更多
        showMoreBtn () {
            console.log('辅助工具',this.btnList.length)
            if (this.btnList.length > 3 ) {
                this.isActive = !this.isActive
            }
        },
        // 显示提示
        showTipPop () {
            this.showTip = !this.showTip
        },
        // 关闭提示
        closeTip () {
            this.showTip = !this.showTip
        },
        // 显示弹窗
        openBlock () {
            let list = JSON.stringify(this.nowLabels)
            this.checkList = JSON.parse(list)
            this.labelShow = true
            this.resolveLabel()
        },
        // 关闭弹窗
        closeBlock () {
            this.labelShow=false
        },
        // 筛选标签
        resolveLabel () {
            this.chooseList=this.allLabels.filter(x => this.checkList.indexOf(x) < 0)
        },
        // 增加标签
        addLabel (idx) {
            this.checkList.push(this.chooseList[idx])
            this.chooseList.splice(idx,1)
        },
        // 取消标签
        cancelLabel (idx) {
            this.chooseList.push(this.checkList[idx])
            this.checkList.splice(idx,1)
        },
        // 获取已有标签
        getNowLabel (flag) {
            this.$axiosHttp.http({
                name:'',
                url: apiUrl.getExitLabelList,
                needFailCallback: true,
                method: 'POST',
                params: {
                    customerNo: this.detailInfo.customerNo,
                    customerStatus: this.detailInfo.customerStatus=='TC'?2:1
                },
            }, (res) => {
                console.log(res)
                let list= res.data.data
                this.nowLabels = list.map(x => {return x.label})
                this.checkList = list.map(x => {return x.label})
                // 取到已有数据后 显示标签
                this.showLabel = true
                this.labelShow = false
                if(flag==1){
                    this.getAllLabel()
                }
            },res => {
                console.log(res)
            });
        },
        // 获取所有标签
        getAllLabel () {
            this.$axiosHttp.http({
                name:'',
                url: apiUrl.getAllLabelList,
                needFailCallback: true,
                method: 'POST',
                params: {},
            }, (res) => {
                console.log(res)
                let list=res.data.data
                this.allLabels=list.map(x => {return x.statusName})
                this.resolveLabel()
            },res => {
                console.log(res)

            });
        },
        // 提交标签
        submitLabel () {
            this.labelShow = false
            this.$axiosHttp.http({
                name:'',
                url: apiUrl.editCustomerLabel,
                needFailCallback: true,
                method: 'POST',
                params: {
                    customerNo: this.detailInfo.customerNo,
                    addLabelList: this.checkList.join(','), //添加标签内容
                    customerStatus: this.detailInfo.customerStatus=='TC'?2:1, //客户来源 ：1:统一客户 2;跟踪客户
                },
            }, (res) => {
                console.log(res)
                // 成功后刷新数据
                this.getNowLabel(0)
            },res => {
                console.log(res)
            });
        }
    },
    watch: {
        labelShow: function (val) {
          if(val) {
			  console.log('打开')
			  ModalHelper.afterOpen()
          } else {
			  console.log('关闭')
			  ModalHelper.beforeClose()
          }
		}
    }
};
</script>
